Repository navigation
fix(server): Claude memory runs return structured output again - #173
Conversation
Isolated text generation (memory extraction, fact checks, memory curation, conversation summaries, model evaluations) passed `--disallowedTools *`. Claude CLI 2.1.329 then exits 0 without a `structured_output` key, so every isolated run failed. `--tools ""` already removes every tool, so the flag added no isolation. Drop it and assert it stays out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ScriptedAlchemy
left a comment
There was a problem hiding this comment.
Reviewed the isolated Claude invocation and fixture changes. The invocation retains safe mode, an empty built-in tool list, and disabled setting sources. The fixture covers removal of the wildcard denial that blocked structured output.
Problem
Every isolated Claude text-generation run fails: memory extraction (
generateKnowledgeCandidates),checkFactStanding,curateProjectMemory,generateConversationSummaryandgenerateModelEvaluation. The CLI exits 0, but its JSON reply has nostructured_outputkey, so the result is discarded and nothing is saved to project memory. Thread titles keep working because they are not isolated.The cause is
--disallowedTools '*'in the isolated argument list (ClaudeTextGeneration.ts:337). With Claude CLI 2.1.329 that flag also blocks the internal tool the CLI uses to return--json-schemaoutput, so the model replies in plain text. Repro with the same schema,--tools ""and--setting-sources ""on every run:structured_output--safe-mode --disallowedTools '*'(current isolated args)--safe-mode{"ok":true}--disallowedTools '*'Change
Drop
--disallowedTools *from the isolated arguments. It isolated nothing: isolated runs never investigate, so they already pass--tools ""(line 333), which removes every tool.--safe-mode,--setting-sources "", the temporary working directory and--strict-mcp-configare unchanged.The three isolated tests asserted the broken flag. They now require
--safe-mode --setting-sourcesand forbid both--bareand--disallowedTools. To allow that, the fake CLI fixture readsT3_FAKE_CLAUDE_ARGS_MUST_NOT_CONTAINas one forbidden fragment per line. The fixture's existing check that--toolsis""still holds for these runs.Scope
Bug fix for an obvious regression with the repro above; no separate issue.
Verification
vp test run src/textGeneration/ClaudeTextGeneration.test.tsfails the 3 isolated tests (args missing expected content). GREEN after the fix:vp test run src/textGeneration/passes 153/153 in 9 files.vp checkis clean on the 3 changed files.main, I set the Claude binary path to a wrapper that only removes--disallowedTools *when--json-schemais present. From the server trace (ClaudeTextGeneration.*spans, 2026-11-20 UTC): before the change, 14curateProjectMemoryand 52generateConversationSummaryruns, allFailure. In the first ten minutes after, 6curateProjectMemory, 54generateConversationSummary, 3generateKnowledgeCandidatesand 1checkFactStanding, allSuccess.